#include "OptionsState.h"
#include "../CGame.h"
#include "CMainMenuState.h"
#include "..\Wrappers\CSGD_Direct3D.h"
#include "..\Wrappers\CSGD_DirectInput.h"
#include "..\Wrappers\CSGD_FModManager.h"
#include "..\Wrappers\CSGD_TextureManager.h"

COptionsState::COptionsState()
{

}
COptionsState* COptionsState::GetInstance()
{
	static COptionsState instance;
	return &instance;
}

COptionsState::~COptionsState()
{

}

void COptionsState::Enter()
{
	

}

void COptionsState::Render()
{

	CSGD_Direct3D* pD3D = CSGD_Direct3D::GetInstance();
	CSGD_TextureManager* pTM = CSGD_TextureManager::GetInstance();
	pD3D->Clear(0, 128, 128);
	pD3D->DeviceBegin();
	pD3D->SpriteBegin();

	//pTM->Draw(m_nCursorID, 1, m_nCursorIndex*20 + 30);

	pD3D->DrawTextA("optionState", 20, 10);
	
	pD3D->GetSprite()->Flush();
	pD3D->DeviceEnd();
	pD3D->SpriteEnd();

	pD3D->Present();

}

void COptionsState::Exit()
{
}

bool COptionsState::Input()
{
		CSGD_DirectInput* pDI = CSGD_DirectInput::GetInstance();
	
	if(pDI->KeyPressed(DIK_RETURN)||  pDI->JoystickButtonPressed(2) )
	{
		CGame::GetInstance()->ChangeState(CMainMenuState::GetInstance());

	}
	return true;
}

void COptionsState::Update(float _fDT)
{
	

}

int COptionsState::GetSoundID()
{
	return 1;
}